﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace drawing_print.util
{
    /// <summary>
    /// 图片处理流程步骤
    /// </summary>
    public class Procedure
    {
        // 旋转角度
        private Int32 angle;
        // 对比度
        private Int32 contrast;
        // 是否遮挡
        private Boolean isCover;
        // 放大缩小
        private Double deflate;
        // 存储修改后的图片
        private Bitmap image;
        // 类型
        private string type;

        public Procedure()
        {

        }
        /// <summary>
        /// 初始化流程
        /// </summary>
        /// <param name="imagePath"></param>
        /// <returns></returns>
        public static Procedure init(Bitmap imagePath)
        {
            Procedure procedure = new Procedure();
            procedure.Angle = InitRecord.Angle;
            procedure.Contrast = InitRecord.Contrast;
            procedure.IsCover = InitRecord.IsCover;
            procedure.Deflate = InitRecord.Deflate;
            procedure.Type = "Init";
            //procedure.Image = new Bitmap(Bitmap.FromFile(imagePath));
            procedure.Image = imagePath;
            return procedure;

        }

        public static Procedure copy(Procedure procedure)
        {
            Procedure pro = new Procedure();
            pro.angle = procedure.Angle;
            pro.contrast = procedure.Contrast;
            pro.isCover = procedure.IsCover;
            pro.deflate = procedure.Deflate;
            pro.image = procedure.Image;
            pro.type = procedure.Type;
            return pro;

        }

        /// <summary>
        /// 角度
        /// </summary>
        public int Angle { get => angle; set => angle = value; }
        /// <summary>
        /// 对比度
        /// </summary>
        public int Contrast { get => contrast; set => contrast = value; }
        /// <summary>
        /// 是否遮挡
        /// </summary>
        public bool IsCover { get => isCover; set => isCover = value; }
        /// <summary>
        /// 缩放
        /// </summary>
        public Double Deflate { get => deflate; set => deflate = value; }
        /// <summary>
        /// 图片
        /// </summary>
        public Bitmap Image { get => image; set => image = value; }
        /// <summary>
        /// 图片
        /// </summary>
        public string Type { get => type; set => type = value; }
     
        
    }
}
